package com.evil.application.pojo.dto.order.log;

import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.annotation.JSONField;
import com.evil.application.pojo.entity.ApplicationOrderLog;
import com.evil.common.account.dto.user.UserBaseRespDTO;
import lombok.Data;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 订单日志 返回实体
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
@Data
public class OrderLogRespDTO {
    /**
     * id
     */
    private Long orderLogId;

    /**
     * 订单id
     */
    private Long orderId;

    /**
     * 节点id
     */
    private Long nodeId;

    /**
     * 节点名称
     */
    private String nodeName;

    /**
     * 处理类型
     */
    private Integer handleType;

    /**
     * 处理人
     */
    @JSONField(serialize = false)
    private List<Long> handlerIds;

    /**
     * 处理人
     */
    private List<UserBaseRespDTO> assignee;

    /**
     * 处理时间
     */
    private Date handleDate;

    /**
     * 备注
     */
    private String remark;

    public OrderLogRespDTO() {
        this.handlerIds = new ArrayList<>();
        this.assignee = new ArrayList<>();
    }

    public OrderLogRespDTO(ApplicationOrderLog applicationOrderLog) {
        this.handlerIds = new ArrayList<>();
        this.assignee = new ArrayList<>();
        BeanUtil.copyProperties(applicationOrderLog, this, "assignee");
    }
}
